package com.tank;

import java.io.IOException;
import java.util.Properties;

/**
 * 配置管理类
 * @author CaoBaoYin
 * @since 2021/8/21 11:46
 */
public class PropertyManager {
    static Properties properties = new Properties() ;
    static {
        try {
            properties.load(PropertyManager.class.getClassLoader().getResourceAsStream("config"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static Object get(String key) {
        if (properties == null) {
            return null;
        }

        return properties.get(key);
    }

    public static void main(String[] args) {
        System.out.println(properties.get("initTankCount"));
    }
}
